<!--首页24小时播客-->
<template>
  <div class="podcast">
    <h4 class="title">{{ podcast.uiElement.subTitle.title }}</h4>
    <div class="content">
      <div class="scroll" :style="{ width: w + '%' }">
        <div
          class="item"
          v-for="(item, index) in podcast.creatives"
          :key="index"
        >
          <div class="cover">
            <img :src="item.uiElement.image.imageUrl" alt="" />
            <div class="mask"><van-icon name="play" /></div>
          </div>
          <span>{{ item.uiElement.mainTitle.title }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["podcast"],
  data() {
    return {
      w: null,
    };
  },
  created() {
    this.w = this.podcast.creatives.length * 30;
  },
};
</script>

<style lang="less" scoped>
.podcast {
  background: #fff;
  padding: 2.666vw;
  margin-bottom: 2.666vw;
  .content {
    overflow-x: scroll;
    .scroll {
      padding: 2.666vw 0;
    }
    .item {
      width: 30%;
      padding: 0 2vw;
      text-align: center;
      color: #514f50;
      .cover {
        position: relative;
        margin-bottom: 2.666vw;
        .mask {
          position: absolute;
          top: 0;
          bottom: 0;
          left: 0;
          right: 0;
          background: rgba(0, 0, 0, 0.3);
          border-radius: 50%;
          i {
            color: #fff;
            font-size: 30px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
          }
        }
      }
      img {
        width: 100%;
        border-radius: 50%;
        display: block;
      }
    }
  }
}
</style>